﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Text;
using Spaanjaars.ContactManager.Model;

namespace Spaanjaars.ContactManager.Repository.EF
{
    public class ContactsContext : ObjectContext
    {        
        private readonly ObjectSet<ContactPerson> _contactPeople;
        private ObjectSet<Address> _addresses;

        public ContactsContext()
            : base("name=ContactsDBEntities1", "ContactsDBEntities1")  
        {
            _addresses = CreateObjectSet<Address>();
            _contactPeople = CreateObjectSet<ContactPerson>();
                        
            base.ContextOptions.LazyLoadingEnabled = true;           
        }

        public ObjectSet<ContactPerson> ContactPeople
        {
            get { return _contactPeople; }
        }
    }
}
